using System;
using System.Collections.Generic;
using System.Text;
using System.Xml;

namespace AzureusWrapper
{
    public class Torrent
    {
        public string Name;
        public long Size;
        public string ObjectId;
        public string Hash;

        public Torrent(XmlNode serializedTorrent)
        {
            this.Name = ((XmlElement)serializedTorrent).GetElementsByTagName("name")[0].InnerText.Trim();
            this.Size = Int64.Parse(((XmlElement)serializedTorrent).GetElementsByTagName("size")[0].InnerText.Trim());
            this.ObjectId = ((XmlElement)serializedTorrent).GetElementsByTagName("_object_id")[0].InnerText.Trim();
            this.Hash = ((XmlElement)serializedTorrent).GetElementsByTagName("hash")[0].InnerText.Trim();
        }
    }
}
